<template>
  <el-table
    v-loading="loading"
    :data="dataSource"
    size="mini"
    border
    style="width: 100%"
  >
    <el-table-column
      v-for="item of tableColumns"
      :key="item.label"
      :label="item.label"
      :prop="item.prop"
      :formatter="item.formatter"
      :width="item.width || 'auto'"
    >
    </el-table-column>
    <slot></slot>
  </el-table>
</template>

<script>
export default {
  props: {
    dataSource: {
      type: Array,
      default: () => [],
    },
    tableColumns: {
      type: Array,
      default: () => [],
    },
    loading: {
      type: Boolean,
      default: false,
    },
  },
};
</script>

<style>
</style>